
package net.minecraft.src;

import java.util.Random;

public class ItemNet extends Item
{

    public ItemNet(int i)
    {
        super(i);
		setMaxDamage(400);
    }

    public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k, int l)
    {
		if(world.getBlockId(i, j, k) == mod_pph.algae.blockID && world.getBlockMetadata(i, j, k) == 0)
		{
			world.setBlockWithNotify(i, j, k, 0);
			EntityItem entityitem = new EntityItem(world, i, j, k, new ItemStack(mod_pph.algaeItem));
			world.entityJoinedWorld(entityitem);
			world.playSoundAtEntity(entityplayer, "mob.chickenplop", 1.0F, (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F + 1.0F);
			return true;
		} else
		if(world.getBlockId(i, j, k) == mod_pph.algae.blockID && world.getBlockMetadata(i, j, k) == 1)
		{
			world.setBlockWithNotify(i, j, k, 0);
			EntityItem entityitem = new EntityItem(world, i, j, k, new ItemStack(mod_pph.algaeItem));
			world.entityJoinedWorld(entityitem);
			EntityItem entityitem2 = new EntityItem(world, i, j, k, new ItemStack(mod_pph.dragonflyEggs));
			world.entityJoinedWorld(entityitem2);
			world.playSoundAtEntity(entityplayer, "mob.chickenplop", 1.0F, (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F + 1.0F);
			return true;
		} else
		if(world.getBlockId(i, j, k) == mod_pph.algae.blockID && world.getBlockMetadata(i, j, k) == 2)
		{
			world.setBlockWithNotify(i, j, k, 0);
			EntityItem entityitem = new EntityItem(world, i, j, k, new ItemStack(mod_pph.dragonflyEggs));
			world.entityJoinedWorld(entityitem);
			world.playSoundAtEntity(entityplayer, "mob.chickenplop", 1.0F, (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F + 1.0F);
			return true;
		} else
		{
			return false;
		}		
    }
	
	public boolean isFull3D()
    {
        return true;
    }

}
